﻿using System;
using System.IO;
using System.Linq;

namespace _011_枚举磁盘驱动器
{
    class Program
    {
        static void Main(string[] args)
        {
            DriveInfo[] 磁盘信息 = DriveInfo.GetDrives();

            var 查询 = from d in 磁盘信息
                     where d.IsReady
                     select d;

            //输出磁盘信息
            foreach (var item in 查询)
            {
                Console.WriteLine($"盘名：{item.Name},类型：{item.DriveType}，空间容量：{item.TotalSize},可用空间：{item.TotalFreeSpace}");
            }


        }
    }
}
